<%@ page language="java"  pageEncoding="UTF-8"%>
<%@taglib uri="/WEB-INF/struts-tags.tld" prefix="s"%>
<script type="text/javascript" src="/js/jquery-1.6.1.min.js"></script>
找不到您想要的地点？请您将需要的地点推荐给我们。谢谢您的支持！
<form method="post" action="userScriptorium.action" id="myform">
<input type="hidden" name="action" value="save"/>
城市:<s:select list="cityList" name="cityId" id="cityId" listKey="key" listValue="value" onchange="onarea(this.value)"></s:select><br>
地区:<s:select list="areaList" name="areaId" id="areaId" listKey="key" listValue="value"></s:select><br>

<select name="scrType">
	<option value="-1">请选择类型</option>
	<option value="1">写字楼</option>
	<option value="2">住宅</option>
	<option value="3">商铺</option>
</select>
名称:<input type="text" name="srcName" id="srcName" maxlength="16"/><br>
<input type="submit" value="提交"/><br>
</form>

<script type="text/javascript"> 
var areas=new Array();
<s:iterator id="a" value="%{areas}" status="st" >
areas[areas.length]=new Array(<s:property value="#a.id"/>,<s:property value="#a.cityId"/>,'<s:property value="#a.areaName"/>');
</s:iterator>
function onarea(cityId){
	$('#areaId').empty();
	$('#areaId').append("<option value='-1'>请选择</option>");   
   for(i=0;i<areas.length;i++){
   	if(cityId == areas[i][1]){
		$('#areaId').append("<option value='"+areas[i][0]+"'>"+areas[i][2]+"</option>");
   	}
   }
}
</script> 